const express = require('express')
const app = express()
var Mock = require('mockjs')
const mockjs = Mock.mock
const port = 8926
app.get('/', (req, res) => {
    res.send("这里都是模拟数据  exp： http://127.0.0.1:8926/api/wx/categories")
})
app.get('/api/wx/categories', (req, res) => {
    res.send({
        "code": 0, "data": [{
            "parentId": null,
            "name": "化妆品",
            "navShow": true,
            "show": true,
            "displayOrder": 1,
            "icon": "https://cdn.renqilai.com/2019_11_01/11_27_19.png",
            "description": "",
            "id": 4648859514183937,
            "clientId": null,
            "createdDate": 1572578841493,
            "lastModifiedDate": 1572600561617,
            "products": 0,
            "parentName": null,
            "subs": [{
                "parentId": 4648859514183937,
                "name": "水乳",
                "navShow": true,
                "show": true,
                "displayOrder": 0,
                "icon": "https://cdn.renqilai.com/2019_11_01/16_55_49.png",
                "description": "",
                "id": 4649182458091777,
                "clientId": null,
                "createdDate": 1572598552423,
                "lastModifiedDate": 1572598552423,
                "products": 0,
                "parentName": null,
                "subs": null
            }, {
                "parentId": 4648859514183937,
                "name": "洗面奶",
                "navShow": true,
                "show": true,
                "displayOrder": 0,
                "icon": "https://cdn.renqilai.com/2019_11_01/16_54_57.png",
                "description": "",
                "id": 4649179036784897,
                "clientId": null,
                "createdDate": 1572598343605,
                "lastModifiedDate": 1572598503957,
                "products": 0,
                "parentName": null,
                "subs": null
            }, {
                "parentId": 4648859514183937,
                "name": "面膜",
                "navShow": true,
                "show": true,
                "displayOrder": 0,
                "icon": "https://cdn.renqilai.com/2019_11_01/16_54_29.png",
                "description": "",
                "id": 4649179654314241,
                "clientId": null,
                "createdDate": 1572598381297,
                "lastModifiedDate": 1572598473488,
                "products": 0,
                "parentName": null,
                "subs": null
            }, {
                "parentId": 4648859514183937,
                "name": "香水",
                "navShow": true,
                "show": true,
                "displayOrder": 1,
                "icon": "https://cdn.renqilai.com/2019_11_01/16_53_20.png",
                "description": "",
                "id": 4649178390452481,
                "clientId": null,
                "createdDate": 1572598304166,
                "lastModifiedDate": 1572598404394,
                "products": 0,
                "parentName": null,
                "subs": null
            }]
        }, {
            "parentId": 4435346796300288,
            "name": "服装",
            "navShow": true,
            "show": true,
            "displayOrder": 4,
            "icon": "https://cdn.renqilai.com/2019_04_25/09_24_07.jpg",
            "description": "日用品",
            "id": 4379779097854209,
            "clientId": null,
            "createdDate": 1556155476239,
            "lastModifiedDate": 1572600203404,
            "products": 0,
            "parentName": null,
            "subs": null
        }]
    })
})
app.get('/api/wx/rubbish/recommend', (req, res) => {
    res.send(mockjs({
        "data|12": [
            {
                "id": "@increment",
                "name": "测试商品测试商品测试商品测试商品测试商品测试商品测试商品",
                "price": 1,
                "sales": 1,
                "coverImage": "@image",
                "credit": 1
            }
        ]
    }))
})

app.listen(port, () => console.log('Example app listening on port !' + port))
